package profile

import (
	"net/http"
	_ "net/http/pprof"
	"testing"

	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/core/config"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/ichain_sdk"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/test/data"
	"github.com/stretchr/testify/assert"
)

func startProfile() {
	http.ListenAndServe("0.0.0.0:8080", nil)
}

func TestSdkInit(t *testing.T) {
	go startProfile()

	env := data.GetEnvFromFlag()
	sdk, err := ichain_sdk.New(config.FromBuilder(env.SdkBuilder()))
	assert.NoError(t, err)
	defer sdk.Close()

	select {}
}
